package view.content;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JTextArea;

import model.contents.Content;

public class LabelView extends ContentBox {

	private JTextArea textLabel;

	public LabelView(Content c, int width, int height) {
		super(c, width, height);
		this.setPreferredSize(new Dimension(width,height));
		this.setLayout(new BorderLayout());
		this.textLabel = new JTextArea();
		this.textLabel.setEditable(false);
		this.textLabel.setLineWrap(true);
		this.textLabel.setWrapStyleWord(true);
		this.textLabel.setBackground(new Color(0,0,0,0));
		this.textLabel.setBorder(null);
		this.add(this.textLabel);
	}

	public void applyLabelFormat(LabelFormat format) {
		format.applyStyle(this);
	}

	public void setText(String text) {
		this.textLabel.setText(text);
		this.revalidate();
		this.repaint();
	}

}
